<?php
class Location_Form_Location_Update extends Zend_Form
{
	public function __construct(Zend_Controller_Action $controller)
	{
		//location_code
		$location_code=$this->createElement ( 'text', 'location_code' )
		->setLabel ( $controller->getHelper('common')->getCaption('location_code') )
		->setAttrib ( 'class','lock' )
		;
		
		//location_name
		$location_name=$this->createElement ( 'text', 'location_name' )
		->setLabel ( $controller->getHelper('common')->getCaption('location_name') )
		->setRequired(true)
		;
		
		//location_warehouse_code
		$location_warehouse_code=$this->createElement ( 'select', 'location_warehouse_code' )
		->setLabel ( $controller->getHelper('common')->getCaption('location_warehouse_code') )
		->setRequired(true)
		;
		
		//location_note
		$location_note=$this->createElement ( 'textarea', 'location_note' )
		->setLabel ( $controller->getHelper('common')->getCaption('location_note') )
		;
		
		//location_status
		$location_status=$this->createElement ( 'radio', 'location_status' )
		->setLabel ( $controller->getHelper('common')->getCaption('location_status') )
		->setMultiOptions(array(1=>'Kích hoạt',0=>'Vô hiệu'))
		->setValue(1)
		;
		
		$this->addElements ( array (
			$location_code,
			$location_name,
			$location_warehouse_code,
			$location_note,
			$location_status,
		) );	
		
		$controller->getHelper ( 'common' )->form ( $this );
	}
}